// import {
//   ADD,
//   MINUS
// } from '../../constants/counter'

import { createRequestTypes } from '@UTILS/reduxHelper'

export const ADD_OPERATION = createRequestTypes('ADD_OPERATION')
export const MINUS_OPERATION = createRequestTypes('MINUS_OPERATION')

export const add = () => ({
  type: ADD_OPERATION.REQUEST
})
export const minus = () => ({
  type: MINUS_OPERATION.REQUEST
})

export const asyncAdd2 = payload => ({
  type: 'ASYNC_ADD',
  payload
})

// 异步的action
export function asyncAdd() {
  return dispatch => {
    setTimeout(() => {
      dispatch(add())
    }, 2000)
  }
}
